/**
 * @license
 * Copyright 2024 The Model Explorer Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ==============================================================================
 */

@keyframes rotating {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.container {
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 11px;
  cursor: pointer;
  color: var(--me-on-surface-variant-color);
  padding: 0 5px;
  background-color: var(--me-surface-color);
  border-radius: 99px;
  border: 1px solid var(--me-outline-variant-color);
  box-sizing: border-box;

  .content {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;

    &:hover {
      opacity: 1;
    }
  }

  &.enabled {
    background-color: var(--me-primary-color);
    color: var(--me-on-primary-color);

    mat-icon {
      color: var(--me-on-surface-inverse-color);
    }
  }

  mat-icon {
    font-size: 18px;
    height: 18px;
    width: 18px;

    &.loading {
      animation: rotating 2s linear infinite;
    }
  }
}

::ng-deep .model-explorer-sync-navigation-dropdown {
  font-size: 12px;
  color: var(--me-on-surface-color);
  background-color: var(--me-surface-container-low-color);
  display: flex;
  flex-direction: column;
  padding-bottom: 12px;

  .section-label {
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 11px;
    background: var(--me-surface-container-high-color);
    font-weight: 500;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;

    .right {
      display: flex;
      align-items: center;
      gap: 4px;

      .icon-container {
        display: flex;
        cursor: pointer;
        opacity: 0.8;

        &:hover {
          opacity: 1;
        }
      }

      mat-icon {
        font-size: 18px;
        height: 18px;
        width: 18px;
        color: var(--me-on-surface-variant-color);
      }
    }
  }

  .section {
    padding-left: 6px;
    padding-right: 16px;
  }

  mat-radio-button {
    cursor: pointer;

    &.cns {
      margin-top: 8px;
    }

    > div[mat-internal-form-field] {
      height: 24px;
    }

    div:has(> input[type='radio']) {
      transform: scale(0.7);
      margin-right: -8px;
    }

    label {
      letter-spacing: normal;
      cursor: pointer;
      font-size: 12px;
      font-family: 'Google Sans Text', 'Google Sans', Arial, Helvetica,
        sans-serif;
    }
  }

  .select-container {
    display: flex;
    flex-direction: column;
    margin-top: 4px;

    .sync-mode-radio-button {
      display: flex;
      align-items: center;
      gap: 4px;
      cursor: pointer;

      input {
        margin-bottom: 4px;
        cursor: pointer;
      }
    }
  }

  .upload-mapping-button {
    margin: 2px 0 0 36px;
    width: 90px;
    height: 30px;
    /* stylelint-disable-next-line declaration-no-important -- override MDC */
    font-size: 12px !important;
    /* stylelint-disable-next-line declaration-no-important -- override MDC */
    letter-spacing: normal !important;
    background-color: var(--me-primary-color);
    color: var(--me-on-primary-color);

    &.cns {
      margin-top: 4px;
    }

    &[disabled] {
      color: var(--me-on-surface-variant-color);
      background-color: var(--me-surface-container-highest-color);
    }

    ::ng-deep .mat-mdc-button-touch-target {
      display: none;
    }
  }

  .upload-mapping-input {
    display: none;
  }

  .uploaded-file-name {
    margin-left: 36px;
    color: var(--me-on-surface-variant-color);
    line-break: anywhere;
    line-height: 14px;
  }

  textarea {
    height: 48px;
    box-sizing: border-box;
    margin: 4px 0 0 36px;
    resize: none;
    border-radius: 3px;
    font-family: sans-serif;
    font-size: 11px;
    padding: 2px;
    line-break: anywhere;
  }

  .match-node-id-checkbox {
    display: flex;
    align-items: center;
    margin-left: 32px;
    margin-bottom: 4px;
    gap: 4px;
  }
}
